import { Sprite } from '@inlet/react-pixi'
import { connect } from 'react-redux'
import { projectLabelView as projectDuck } from 'ducks'
import React from 'react'
import Checkmark from 'icons/ok.png'

const CheckmarkView = ({
  x, y, actionResetEditAndDo, scale,
}) => (
  <Sprite
    image={Checkmark}
    interactive
    buttonMode
    width={40 / scale}
    height={40 / scale}
    x={x}
    y={y}
    anchor={[1, 1]}
    click={() => actionResetEditAndDo()}
  />
)

const mapDispatchToProps = {
  actionResetEditAndDo: projectDuck.creators.actionResetEditAndDo,
}

export default connect(
  null,
  mapDispatchToProps,
)(CheckmarkView)
